package cn.wolfcode.controller;

import cn.wolfcode.util.UploadUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 游记封面文件上传控制器类
 * @Author: 伍家钰
 * @Date: 2020/8/13 14:16
 * @Version: 1.0
 */
@RestController
public class UploadController {
    @RequestMapping("coverImageUpload")
    @ResponseBody
    public Object uploadImg(MultipartFile pic) throws Exception {
        // 执行保存文件,返回文件保存的路径
        String path = UploadUtil.uploadAli(pic);
        return path;
    }
}
